package array.simple;

public class ConsecutiveCharacters_1446 {

    public int maxPower(String s) {
        if (s.length() == 1)
            return 1;
        int c = s.charAt(0);
        int cur = 1;
        int ans = 0;
        for (int i = 1; i < s.length(); i++) {
            if ((c ^ s.charAt(i)) == 0) {
                cur++;
            } else {
                ans = Math.max(ans, cur);
                c = s.charAt(i);
                cur = 1;
            }
        }
        return Math.max(ans, cur);
    }

    public static void main(String[] args) {
        ConsecutiveCharacters_1446 cc = new ConsecutiveCharacters_1446();
        System.out.println(cc.maxPower("cc"));
    }
}
